package com.socialin.picsin.camera.view;

import java.util.List;

import android.content.Context;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.ViewGroup.LayoutParams;

public class CameraViewFroyo extends CameraViewEclair {

	
	public CameraViewFroyo(Context context, LayoutParams layoutParams) {
		super(context, layoutParams);
	}

	public CameraViewFroyo(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	@Override
	public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
		super.surfaceChanged(holder, format, width, height);
	}
	
	@Override
	public void surfaceDestroyed(SurfaceHolder holder) {
		super.surfaceDestroyed(holder);
	}
	
	@Override
	public void setBrightness(int value) {
		params.setExposureCompensation(getMinBrightness() + value);
	}
	
	@Override
	public int getBrightness() {
		return params.getExposureCompensation() - params.getMinExposureCompensation();
	}
	
	@Override
	public int getMinBrightness() {
		return params.getMinExposureCompensation();
	}
	
	@Override
	public int getMaxBrightness() {
		return params.getMaxExposureCompensation();
	}
	
	@Override
	public boolean brightnessSupported() {
		if(getMinBrightness() != getMaxBrightness()){
			return true;
		}
		return false;
	}
	
	@Override
	public boolean zoomSupported() {
		if(params.isZoomSupported()){
			return params.getMaxZoom() > 0;
		}else return false;
	}
	
	@Override
	public int getZoom() {
		return params.getZoom();
	}
	
	@Override
	public void setZoom(int value) {
		params.setZoom(value);
	}
	
	@Override
	public int getZoomMax() {
		return params.getMaxZoom();
	}
	
	@Override
	public List<Integer> getZoomFactors() {
		return params.getZoomRatios();
	}
}
